package shun.demo.finalize;

import android.app.Activity;
import android.os.Bundle;
import shun.demo.R;

/**
 * Created by chen on 2/10/14.
 */
public class ImageActivity extends Activity {

    MyObject myObject;
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MyView myView = new MyView(this);
        myView.setImageResource(R.drawable.ic_launcher);
        myObject = new MyObject(this);
        setContentView(myView);
    }

    @Override
    public String toString() {

        return getClass().getSimpleName() + '@' + Integer.toHexString(hashCode());
    }

    @Override
    protected void finalize() throws Throwable {
        System.out.println("对象销毁：" + this);
    }
}